import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class Exam {
    public Exam() {
    }

    public static void main(String[] var0) {
        TV var1 = new TV();
        var1.setName("长虹电视");
        var1.setPrice(5678);

        File var2 = new File("television.txt");

        try {
            FileOutputStream var3 = new FileOutputStream(var2);
            ObjectOutputStream var4 = new ObjectOutputStream(var3);
            var4.writeObject(var1);
            var4.close();
            FileInputStream var5 = new FileInputStream(var2);
            ObjectInputStream var6 = new ObjectInputStream(var5);
            TV var7 = (TV)var6.readObject();
            var6.close();
            var7.setName("海尔电视");
            var7.setPrice(5233);
            System.out.println(var1.getName());
            System.out.println(var1.getPrice());
            System.out.println(var7.getName());
            System.out.println(var7.getPrice());
        } catch (ClassNotFoundException var8) {
            System.out.println("不能读出对象");
        } catch (IOException var9) {
            System.out.println(var9);
        }

    }
}
